package net.crozz.openapi;


public class ApiException extends Exception {

    private static final long serialVersionUID = 917274389879675215L;
    public String  request;
    public Integer status;
    public String  resp;

    public ApiException(String msg) {
        super(msg);
    }

    public ApiException(Exception cause) {
        super(cause);
    }

    public ApiException(String msg, Exception cause) {
        super(msg, cause);
    }

    public ApiException(String request, Integer status, String resp) {
        this.request = request;
        this.status = status;
        this.resp = resp;
    }

    public ApiException(Exception cause, String request, Integer status, String resp) {
        super(cause);
        this.request = request;
        this.status = status;
        this.resp = resp;
    }

    @Override
    public String getMessage() {
        return "request: " + request + "\nstatus: " + status + "\nresp: " + resp + "\n" + super.getMessage();
    }

}
